/* hal_pctrl.c */

#include "hal_pctrl.h"

void PCTRL_SetPinConf(PCTRL_Type * base, uint32_t pin_idx, PCTRL_PinConf_Type * conf)
{
	base->PCR[pin_idx]  = PCTRL_PCR_MUX(conf->PinMux)
                        | (conf->EnableHighDriveStrength ? PCTRL_PCR_DSE_MASK : 0u)
                        | (conf->EnablePassiveFilter ? PCTRL_PCR_PFE_MASK : 0u)
                        | (conf->EnableSlowRate ? PCTRL_PCR_SRE_MASK : 0u)
                        | (0x3 & conf->PinPullMode)
                        ;
}

/* EOF. */

